import {request} from "@/utils/request";

import type {NursingPlanPageResult} from '../model/NursingPlan'
import {
    EditNursingProjectResult,
    NursingProjectDetailResult,
    NursingProjectListAllResult
} from "@/pages/serve/plan/project/model/NursingProject";
import {
    AddNursingProjectPlan,
    AddNursingProjectPlanResponse,
    getNursingProjectPlanByIdResponse,
    NursingPlanListAll
} from "../model/NursingPlan";

//分页查询护理项目列表
export function searchPlan(params) {
    return request.get<NursingPlanPageResult>({
        url: '/nursing/plan',
        params
    })
}

//删除
export function deletePlan(id) {
    return request.delete<NursingPlanPageResult>({
        url: `/nursing/plan/${id}`
    })
}

//查询后的回显
export function queryAllProject() {
    return request.get<NursingProjectListAllResult>({
        url: '/nursing/plan/list',
    })
}

//修改的编辑

//新增
export function addNursingPlan(data) {
    return request.post<AddNursingProjectPlan>({
        url: '/nursing/plan',
        data
    })
}


// 新增护理项目
export function addNursingProject(data) {
    return request.post<EditNursingProjectResult>({
        url: '/nursing/plan',
        data
    })
}

//根据id查询
export function getNursingPlanDetail(id) {
    return request.get<getNursingProjectPlanByIdResponse>({
        url: `/nursing/plan/${id}`
    })
}


//修改
export function updatePlanDetail(data) {
    return request.put<AddNursingProjectPlanResponse>({
        url: '/nursing/plan',
        data
    })
}









